<?php
$host="db.seng.uvic.ca"; // Host name
$username="se321g01"; // Mysql username
$password="un8bi2YM"; // Mysql password
$db_name="se321g01"; // Database name
$tbl_name="rewards"; // Table name

// Connect to server and select databse.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");


// Get UID
$rid = $_GET['rid'];

// Get post variables
$rewards = $_POST['rewards'];

echo $rewards . "<br/>";

// Delete reward from rewards
mysql_query("DELETE FROM rewards WHERE title='$rewards'");

// Go back to profile
header("location:./profile.php?uid=" . $uid . "&tab=3");

?>
